// TBApi.h: interface for the CTBApi class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_TBAPI_H__047146F5_9E75_45A5_BEAF_9BBCF67621AE__INCLUDED_)
#define AFX_TBAPI_H__047146F5_9E75_45A5_BEAF_9BBCF67621AE__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "TBParmeter.h"
#include "TBApiContext.h"

#include "Markup.h"
//#include "COMUTIL.H"


class CTBApi  
{
protected:
	CTaobaoParmeter m_pa;
	CTBApiContext	m_ctx;
protected:
	CMarkup	m_xmlParser;
	CPtrList	m_listItem;//DESCRIPTIONS LIST

	CString m_url;
	CString m_xml;
public:
	CTBApi(CTBApiContext& ctx);
	CTBApi();
	virtual ~CTBApi();
public:
	void GetRetXML(CString& sURL,CString & sXML);
	CPtrList* GetList();
	void SetContext(CTBApiContext* pCtx);
//	static void ConvertGB2312toUTF8(const char *unistring, char *outbuffer, int len);
//	static void ConvertUTF8toGB2312(CString str, _bstr_t &bstr);
protected:
	BOOL OpenURLGet(CString sURL,CString& strXML);
};

#endif // !defined(AFX_TBAPI_H__047146F5_9E75_45A5_BEAF_9BBCF67621AE__INCLUDED_)
